<?php
echo "<table id = 'list_catbyid'>";
	$limit = count($danhba);
	for($i=0;$i<$limit;$i=$i+4){
		echo "<tr>";
			echo "<td class='list_catbyid_td'>";
				if (isset($danhba[$i]['id'])){
					echo "<table class='list_catcontent'><tr>";
						echo "<td class='catname' colspan='2'>";
							echo "<font color='green'><b> Company name : ".$danhba[$i]['company_name']."</b></font>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catimages' align='center' rowspan='2'>";
							echo "<ul>";
								echo "<li><a href='http://google.com' rel='".base_url()."public/images/".$danhba[$i]['img1']."' title='Phone: ".$danhba[$i]['phone']."' class='preview'><img alt='logo' src='".base_url()."public/images/".$danhba[$i]['img1']."' width='100' height='100'/></a></li>";
							echo "</ul>";
						echo "</td>";
						echo "<td class='catinquiry'>";
							echo "<input type='button' value='Inquiry' class='btcatinquiry'/>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catmoredetails'>";
							echo "<input type='button' value='More details' class='btcatmoredetails'/>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catdetails' colspan='2'>";
							echo "<b> Address : </b>".$danhba[$i]['address']."<br/>";
							echo "<b> Phone : </b>".$danhba[$i]['phone']."<br/>";
							echo "<b> Services offered : </b>".$danhba[$i]['services_offered'];
						echo "</td>";
					echo "</tr></table>";
				}
			echo "</td>";
			echo "<td class='list_catbyid_td'>";
				$j1=$i+1;
				if (isset($danhba[$j1]['id'])){
					echo "<table class='list_catcontent'><tr>";
						echo "<td class='catname' colspan='2'>";
							echo "<font color='green'><b> Company name : ".$danhba[$j1]['company_name']."</b></font>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catimages' align='center' rowspan='2'>";
							echo "<li><a href='http://google.com' rel='".base_url()."public/images/".$danhba[$j1]['img1']."' title='Phone: ".$danhba[$j1]['phone']."' class='preview'><img alt='logo' src='".base_url()."public/images/".$danhba[$j1]['img1']."' width='100' height='100'/></a></li>";
						echo "</td>";
						echo "<td class='catinquiry'>";
							echo "<input type='button' value='Inquiry' class='btcatinquiry'/>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catmoredetails'>";
							echo "<input type='button' value='More details' class='btcatmoredetails'/>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catdetails' colspan='2'>";
							echo "<b> Address : </b>".$danhba[$j1]['address']."<br/>";
							echo "<b> Phone : </b>".$danhba[$j1]['phone']."<br/>";
							echo "<b> Services offered : </b>".$danhba[$j1]['services_offered'];
						echo "</td>";
					echo "</tr></table>";
				}
			echo "</td>";
			echo "<td class='list_catbyid_td'>";
				$j2=$i+2;
				if (isset($danhba[$j2]['id'])){
					echo "<table class='list_catcontent'><tr>";
						echo "<td class='catname' colspan='2'>";
							echo "<font color='green'><b> Company name : ".$danhba[$j2]['company_name']."</b></font>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catimages' align='center' rowspan='2'>";
							echo "";
							echo "<li><a href='http://google.com' rel='".base_url()."public/images/".$danhba[$j2]['img1']."' title='Phone: ".$danhba[$j2]['phone']."' class='preview'><img alt='logo' src='".base_url()."public/images/".$danhba[$j2]['img1']."' width='100' height='100'/></a></li>";
						echo "</td>";
						echo "<td class='catinquiry'>";
							echo "<input type='button' value='Inquiry' class='btcatinquiry'/>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catmoredetails'>";
							echo "<input type='button' value='More details' class='btcatmoredetails'/>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catdetails' colspan='2'>";
							echo "<b> Address : </b>".$danhba[$j2]['address']."<br/>";
							echo "<b> Phone : </b>".$danhba[$j2]['phone']."<br/>";
							echo "<b> Services offered : </b>".$danhba[$j2]['services_offered'];
						echo "</td>";
					echo "</tr></table>";
				}
			echo "</td>";
			echo "<td class='list_catbyid_td'>";
				$j3=$i+3;
				if (isset($danhba[$j3]['id'])){
					echo "<table class='list_catcontent'><tr>";
						echo "<td class='catname' colspan='2'>";
							echo "<font color='green'><b> Company name : ".$danhba[$j3]['company_name']."</b></font>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catimages' align='center' rowspan='2'>";
							echo "<li><a href='http://google.com' rel='".base_url()."public/images/".$danhba[$j3]['img1']."' title='Phone: ".$danhba[$j3]['phone']."' class='preview'><img alt='logo' src='".base_url()."public/images/".$danhba[$j3]['img1']."' width='100' height='100'/></a></li>";
						echo "</td>";
						echo "<td class='catinquiry'>";
							echo "<input type='button' value='Inquiry' class='btcatinquiry'/>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catmoredetails'>";
							echo "<input type='button' value='More details' class='btcatmoredetails'/>";
						echo "</td>";
					echo "</tr>";
					echo "<tr>";
						echo "<td class='catdetails' colspan='2'>";
							echo "<b> Address : </b>".$danhba[$j3]['address']."<br/>";
							echo "<b> Phone : </b>".$danhba[$j3]['phone']."<br/>";
							echo "<b> Services offered : </b>".$danhba[$j3]['services_offered'];
						echo "</td>";
					echo "</tr></table>";
				}
			echo "</td>";
		echo "</tr>";
	}
	echo "<tr>";
		echo"<td colspan='4' class='list_catbyid_td'>";
			echo $this->pagination->create_links(); 
		echo "</td>";
	echo "</tr>";
echo "</table>";